/*
 * @Author: Jianmao-H 1283197884@qq.com
 * @Date: 2022-06-14 14:21:13
 * @LastEditors: Jianmao-H 1283197884@qq.com
 * @LastEditTime: 2022-06-14 14:28:08
 * @FilePath: \shoppingmall\src\utils\stampToTime.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */




// yyyy-MM-dd hh:mm:ss
function stampToTime(timeStamp) {
    let Y;
    let M;
    let D;
    let h;
    let m;
    let s;
    let date = new Date(timeStamp);
    Y = date.getFullYear() + '-';
    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
    D = date.getDate() + ' ';
    h = date.getHours() + ':';
    m = date.getMinutes() + ':';
    s = date.getSeconds();
    return Y + M + D + h + m + s;
}

export default {
    stampToTime
}
